package edu.sctu.practice.class02.xuejiahua.assign03.ass03;

/**
 * Created by Administrator on 2015/10/29.
 */
public class Main {

    public static void main(String[] args) throws CloneNotSupportedException {
        Name name = new Name();
        name.setFirstName("王");
        name.setMiddlName("二");
        name.setLastName("大");

        CloneableCircle cloneableCircle = new CloneableCircle();
        cloneableCircle.setCreator(name);

        CloneableCircle cloneableCircle1 = (CloneableCircle) cloneableCircle.clone();
        cloneableCircle.getCreator().setLastName("大");
        cloneableCircle.getCreator().setMiddlName("二");
        cloneableCircle.getCreator().setFirstName("王");

        System.out.println(cloneableCircle.getCreator().firstName + cloneableCircle.getCreator().getMiddlName()
                + cloneableCircle.getCreator().getLastName());
        System.out.println(cloneableCircle1.getCreator().firstName + cloneableCircle1.getCreator().getMiddlName()
                + cloneableCircle1.getCreator().getLastName());

    }
}
